Map

Map takes a function f and a list xs and applies f to every element of xs. For example,

#math152#
Map~f~[1, 2, 3] = #tex2html_wrap_indisplay2628# : #tex2html_wrap_indisplay2629##tex2html_wrap_indisplay2630#Foldr#tex2html_wrap_indisplay2631#@@6<#7#>6<#5#>#tex2html_wrap_indisplay2632#! :}f~[1, 2, 3]  

This is another job for Foldr.
#math153#
Map~f = Foldr~(Compose~Cons~f )~Nil  

We shall see Map used later on, to convert from a list of names such as :<#914#><#916#>Foldr@<#918#>@<#918#><#697#>6<#922#><#924#><<#924#><#922#><#923#><<#923#>7>><#916#><#695#>6<#925#><#927#><<#927#><#925#><#926#><<#926#>5>><#914#><#915#><#915#>!:}<#362#><#929#><<#929#><362>>[Fac-yawn,Fac-cows], to a list of labels such as :<#937#><#939#>Foldr@<#943#>@<#943#><#647#><<#944#><<#950#>Insert@<#955#>@<#955#><#956#><#956#><#950#><#653#><<#951#><#951#><#952#><#952#>653>><#944#><#651#><<#945#><<#945#><#946#><#946#>651>>647>><#939#><#645#><<#940#><<#947#>Insert@<#953#>@<#953#><#954#><#954#><#947#><#667#><<#948#><#948#><#949#><#949#>667>><#940#><#665#><<#941#><<#941#><#942#><#942#>665>>645>><#937#><#938#><#938#>!:}:<#961#><#963#>Foldr@<#965#>@<#965#><#697#>6<#969#><#971#><<#971#><#969#><#970#><<#970#>7>><#963#><#695#>6<#972#><#974#><<#974#><#972#><#973#><<#973#>5>><#961#><#962#><#962#>!:}Number-:;SPMlt;Foldr@<#958#>9<#977#>Label-<<#977#><#978#><<#978#>8>><#959#><#959#> <#932#><#932#>!:}[Fac-yawn,Fac-cows].